(function() {
    tinymce.create("tinymce.plugins.wordpaster_button", {

        //url argument holds the absolute url of our plugin directory
        init : function(ed, url) {

            ed.addButton("wordpaster", {
                title : "Word一键粘贴",
                onclick:function(){
                    WordPaster.getInstance().SetEditor(ed);
                    WordPaster.getInstance().Paste();
                },
                image: url+"/paster.png",
            });
            ed.addButton("pptpaster", {
                title : "PowerPoint一键粘贴",
                onclick:function(){
                    WordPaster.getInstance().SetEditor(ed);
                    WordPaster.getInstance().PastePPT();
                },
                image : url + "/ppt.png",
            });
            ed.addButton("pdfimport", {
                title : "一键导入pdf",
                onclick:function(){
                    WordPaster.getInstance().SetEditor(ed);
                    WordPaster.getInstance().ImportPDF();
                },
                image : url + "/pdf.png",
            });
            ed.addButton("netpaster", {
                title : "上传Web图片",
                onclick:function(){
                    WordPaster.getInstance().SetEditor(ed);
                    WordPaster.getInstance().UploadNetImg();
                },
                image : url + "/net.png",
            });

        },

        createControl : function(n, cm) {
            return null;
        },

        getInfo : function() {
            return {
                longname : "AZ Custom Editor Buttons",
                author : "Aspirant Zhang",
                version : "1"
            };
        }
    });

    tinymce.PluginManager.add("wordpaster_button", tinymce.plugins.wordpaster_button);
})();